﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

/**
 * script that triggers an increasing amount of voice sources
 */
public class Voices : MonoBehaviour {

	public List<AudioSource> sources;
	public float newVoiceInterval;

	public void TriggerVoices()
	{
		StartCoroutine(DoTriggerVoices());
	}

	private IEnumerator DoTriggerVoices()
	{
		int i=0;
		while(i<sources.Count)
		{
			sources[i].Play();
			yield return new WaitForSeconds(newVoiceInterval);
			i++;
		}
	}
}
